package com.heima.zhujie02;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class MainText {
    public static void main(String[] args) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException, InstantiationException, NoSuchMethodException {
        Class forName = Class.forName("com.heima.zhujie02.Text");
        Text o = (Text) forName.getConstructor().newInstance();
        Method[] methods = forName.getDeclaredMethods();
        for (Method method : methods) {
           if(method.isAnnotationPresent(UseText.class)){
               method.invoke(o);
           }
        }

    }
}
